package com.william.jdbcplus.test.entity;

import com.william.jdbcplus.common.annotation.*;
import com.william.jdbcplus.common.entity.Entity;
import com.william.jdbcplus.common.enums.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@Table("db_b")
@ApiModel("B表")
@TableIndexs({
        @TableIndex(fields = {"englishStr", "englishStrOrNull"}),
})
public class B implements Entity {
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", remarks = "主键", type = IdType.GUID)
    private String id;

    @TableColumn(remarks = "名称")
    @TableUk
    private String name;

    @ApiModelProperty(value = "C表主键")
    @TableFk(pkEntity = C.class, pkField = "id")
    private String cId;

    @ApiModelProperty(value = "D表主键")
    @TableFk(pkEntity = D.class, pkField = "id")
    private String dId;

    @TableColumn(remarks = "英文字符串", size = 40, nullable = false)
    private String englishStr;

    @TableColumn(remarks = "英文字符串或空", size = 60)
    private String englishStrOrNull;
}
